<?php

namespace app\admin\validate;

use think\Validate;

class Shop extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'id' => 'require',
        'shopname' => 'require',
        'mobile' => 'require',
        'images' => 'require',
        'business_hours' => 'require',
        'tips' => 'require',
        'address' => 'require',
        'longitude' => 'require',
        'latitude' => 'require',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'id.require' => '请填写ID',
        'shopname.require' => '请填写店铺名称',
        'mobile.require' => '请填写手机号',
        'images.require' => '请填写图片',
        'business_hours.require' => '请填写营业时间',
        'tips.require' => '请填写店铺标签',
        'address.require' => '请填写店铺地址',
        'longitude.require' => '请填写经度',
        'latitude.require' => '请填写纬度',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add' => ['shopname', 'mobile', 'images', 'business_hours', 'tips', 'address', 'longitude', 'latitude'],
        'edit' => ['id', 'shopname', 'mobile', 'business_hours', 'tips', 'address', 'longitude', 'latitude'],
        'info' => ['id']
    ];

}
